<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    // random和取整三个方法
    // 取整：round：四舍五入、floor（地板,向下取整）、ceil（天花板，向上取整）
    console.log(Math.round(123.623)); // 124
    console.log(Math.floor(123.623)); // 123
    console.log(Math.ceil(123.123)); // 124

    // 随机数
    console.log(Math.random()); // 0-1
    console.log(Math.random()*10); // 0-10
    // 随机数取整
    console.log(Math.round(Math.random()*10));
    console.log(parseInt(Math.random()*10));
</script>
</body>
</html>